package com.fieldchain.ex.fa100.utils.animator;

import android.animation.Animator;
import android.animation.ValueAnimator;

import com.fieldchain.ex.fa100.inter.MyValueListener;

public class AnimationUtils {
    public static void setListener(ValueAnimator animator, final MyValueListener listener){
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                listener.onAnimationUpdate(valueAnimator);
            }
        });
        animator.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animator) {

            }

            @Override
            public void onAnimationEnd(Animator animator) {
                listener.onAnimationEnd(animator);
            }

            @Override
            public void onAnimationCancel(Animator animator) {

            }

            @Override
            public void onAnimationRepeat(Animator animator) {

            }
        });
    }
}
